package com.sy.test.takenumberdemo.ui;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.sy.test.takenumberdemo.R;
import com.sy.test.takenumberdemo.bean.Game;
import com.sy.test.takenumberdemo.bean.GameTime;
import com.sy.test.takenumberdemo.contract.EndContract;
import com.sy.test.takenumberdemo.presenter.EndPresenter;
import com.sy.test.takenumberdemo.utils.BaseFragmentActivity;

import java.util.ArrayList;
import java.util.HashMap;

public class TakeNumberActivity extends BaseFragmentActivity implements EndContract.View{

    private EndPresenter endPresenter = new EndPresenter(this);
    private Button test_btn;
    private String week = "1";
    private String page = "1";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected int getContentViewId() {
        return R.layout.activity_take_number;
    }

    @Override
    protected void init() {
        test_btn = findViewById(R.id.test_btn);
        test_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                initNewData(week,page);
            }
        });
    }

    @Override
    protected void initBundleData() {

    }

    //新的数据请求方式 封装
    private void initNewData(String week,String page) {
        endPresenter.requestGameData(page,week);
    }

    @Override
    public void onGetGameData(ArrayList<Game> list, HashMap<String, GameTime> gameTimeList) {

    }
}
